<?php
//
// 通知消息接口
//
class Controller_API_Message extends Controller
{
    public function __construct ($req, $res)
    {
        parent::__construct($req, $res);
    }

    public function action_get ($uid = 0)
    {
        try {
            $msgs = App_Message::lists($uid);
            $ret  = array(
                'status' => 0,
                'errormsg' => '',
                'messages' => $msgs,
            );
        }
        catch (Exception $e)
        {
            $ret = array(
                'status' => 0,
                'errormsg' => $e->getMessage(),
            );
        }

        echo json_encode($ret);
    }
}
